package com.ycj.service.imp;

import org.apache.ibatis.session.ResultContext;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ycj.model.User;
import com.ycj.service.IMyService;

@Service("myService")
public class MyService implements IMyService {
	 @Autowired
	  public SqlSessionFactory sqlSessionFactory;

	@Transactional
	public String getInfo() {
		SqlSession session =sqlSessionFactory.openSession();
		//session.insert("com.ycj.insertUser", new User(1, "jiejie", 45));
		User user=session.selectOne("com.ycj.findById" );
		return user.getName();
	}
	  
	

}
